/* ManageMain Page Styles */

.manage-container {
  height: 97%;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}

.manage-card {
  background: var(--color-background-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-card {
  padding: 0.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-icon {
  width: 68px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.header-text .header-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 0.01rem 0;
}

.header-text .header-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

.main-card {
  flex: 1;
  overflow: hidden;
  min-height: 0; /* Fix for flex overflow */
}

.main-layout {
  display: flex;
  height:99%;
}

.sidebar {
  min-width: 120px;
  max-width: 400px;
  background: var(--color-surface-secondary);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  min-height: 0; /* Fix for flex overflow */
  transition: width 0.1s ease-out;
}

.resize-handle {
  width: 4px;
  background: transparent;
  cursor: col-resize;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resize-handle:hover {
  background: var(--color-border);
}

.resize-handle:hover .resize-line {
  opacity: 1;
}

.resize-line {
  width: 2px;
  height: 40px;
  background: var(--color-accent);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-header {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  min-height: 0;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 0.5rem;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top: 2px solid var(--color-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.875rem;
}

.menu-item:hover {
  background: var(--color-surface);
}

.menu-item.active {
  background: var(--color-accent);
  color: white;
}

.menu-item.active .menu-icon {
  color: white;
}

.menu-icon {
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.menu-icon.active {
  color: var(--color-accent);
}

.menu-text {
  font-weight: 500;
  line-height: 1.2;
  word-break: break-word;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.sidebar-footer {
  border-top: 1px solid var(--color-border);
  padding: 0.5rem;
  flex-shrink: 0;
}

.footer-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-action-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.875rem;
  background: none;
  border: none;
  color: var(--color-text-primary);
  text-align: left;
  width: 100%;
}

.footer-action-item:hover {
  background: var(--color-surface);
}

.action-icon {
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.action-text {
  font-weight: 500;
}

.content-area {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  min-height: 0;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
}

.action-button.primary {
  background: var(--color-accent);
  color: white;
}

.action-button.primary:hover {
  background: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.action-button.secondary {
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.action-button.secondary:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.button-icon {
  width: 16px;
  height: 16px;
}

/* Dialog styles */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.dialog-container {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
}

.dialog-header {
  padding: 1.5rem 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dialog-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.dialog-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.dialog-close:hover {
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
}

.close-icon {
  width: 16px;
  height: 16px;
}

.dialog-content {
  padding: 1.5rem;
}

.choice-cos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.picbed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  background: var(--color-surface-elevated);
}

.picbed-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.picbed-card.active {
  border-color: var(--color-accent);
  background-color: rgba(64, 158, 255, 0.1);
}

.picbed-card.main-card {
  border-color: var(--color-error);
}

.picbed-card.main-card:hover {
  border-color: var(--color-error);
  background-color: rgba(255, 59, 48, 0.1);
}

.card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.picbed-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.main-icon {
  width: 24px;
  height: 24px;
  color: var(--color-error);
}

.card-content {
  text-align: center;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.main-title {
  color: var(--color-error);
}

.check-icon {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 20px;
  height: 20px;
  color: var(--color-accent);
}

/* Drawer styles */
.drawer-overlay {
  position: fixed;
  top: 32px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 2000;
}

.drawer-container {
  background: var(--color-surface);
  height: 100vh;
  width: 400px;
  max-width: 90vw;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.drawer-close:hover {
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
}

.drawer-content {
  padding: 1.5rem;
}

.form-header {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.form-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picbed-form-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.form-divider {
  height: 1px;
  background: var(--color-border);
  margin: 1.5rem 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  transition: var(--transition-fast);
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.input-group {
  display: flex;
}

.group-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.input-append {
  padding: 0.75rem;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  border-left: none;
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.select-wrapper {
  position: relative;
}

.form-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-elevated);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  appearance: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.select-arrow {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary);
  pointer-events: none;
}

.switch-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.switch-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.switch-slider {
  position: relative;
  width: 3rem;
  height: 1.5rem;
  background: var(--color-border);
  border-radius: 0.75rem;
  transition: var(--transition-fast);
}

.switch-button {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background: white;
  border-radius: 50%;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.switch-input:checked + .switch-slider {
  background: var(--color-accent);
}

.switch-input:checked + .switch-slider .switch-button {
  transform: translateX(1.5rem);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: flex-end;
}
